package com.TestDemo.TempTest;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/22/11:08
 * @Description:
 * @Target:
 */
public class 这个缺陷是谁的 {

    public static void main(String[] args) {
        System.out.println("请输入缺陷号,可多个:");
        Scanner input = new Scanner(System.in);
        String ss = input.nextLine();
        System.out.println("缺陷分配中....");
        GetIntByString(ss);
        System.out.println("缺陷分配完成!");

    }


    // 设置一个方法,这个方法可以捕获字符串中的数字,并进行计算,返回名字加缺陷号
    public static void GetIntByString(String ss){

        String numString = "";  // 用于记录数字

        int count = 0;
        for (int i = 0; i <= ss.length()-1; i++) {
            if(ss.charAt(i)>='0'&&ss.charAt(i)<='9'){
                numString+=ss.charAt(i);
                count = i;
            }else {
               if (count<=0){
                   continue;
               }else {
                   break;
               }
            }
        }


        if(count>0&&(ss.substring(count+1,ss.length())).length()>4){
            GetIntByString(ss.substring(count+1,ss.length()));
        }

        IsOrNotIs(numString);

    }


    // 判断方法
    public static void IsOrNotIs(String numString){
        String end = ""+Integer.MIN_VALUE;
        int num = Integer.MIN_VALUE;
        num = Integer.valueOf(numString);

        if(num%3==1){
            end = "zjz + CNAPS-" + numString;
        }else if(num%3==0){
            end = "gehao + CNAPS-" + numString;
        }else {
            end = "liye + CNAPS-" + numString;
        }

        System.out.println(end);
    }

}
